﻿Public Class ClsMantenedor
    Dim insert As String = ""
    Dim values As String = ""
    Dim where As String = ""
    Dim update As String = ""
    Dim Campos As String = ""

    Sub CrearRegistro(ByRef Ctl As Control, ByVal tabla As String)
        insert = " Insert into " & tabla

        Dim i As Integer
        For i = 0 To Ctl.Controls.Count - 1
            CrearInsert(Ctl.Controls(i))
        Next

        insert = insert & "( " & Campos & ")"

    End Sub
    Sub ModificarRegistro(ByRef ArrayObjetos() As Control)

    End Sub
    Sub CrearInsert(ByVal Ctl As Control)
        If Ctl.Controls.Count > 1 Then
            Dim i As Integer
            For i = 0 To Ctl.Controls.Count - 1
                CrearInsert(Ctl.Controls(i))
            Next
        Else
            If Ctl.GetType.ToString = "Anthem.TextBox" Then
                If Mid(Ctl.ID, 1, 1).ToUpper <> "P" Then
                    If Campos.Length = 0 Then
                        Campos = Ctl.ID

                    Else
                        Campos = Campos & "," & Ctl.ID
                    End If

                End If
            End If

            If Ctl.GetType.ToString = "Anthem.DropDownList" Then
                If Campos.Length = 0 Then
                    Campos = Ctl.ID
                Else
                    Campos = Campos & "," & Ctl.ID
                End If

            End If



        End If

    End Sub
    Private Function GetValor(ByRef Ctl As Control) As String
        If Ctl.GetType.ToString = "Anthem.TextBox" Then

        End If

        If Ctl.GetType.ToString = "Anthem.DropDownList" Then

        End If
    End Function

    Sub CargaComboBox()

    End Sub
End Class
